<?php

// +----------------------------------------------------------------------
// | product_image 模型
// +----------------------------------------------------------------------
// | @author fancsen
// +----------------------------------------------------------------------

namespace app\api\model;

use app\api\model\BaseModel;

class ProductImage extends BaseModel 
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'product_image';
    //自动时间戳
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $deleteTime = 'delete_time';
    //隐藏字段
    protected $hidden = ['id','delete_time','product_id','img_id','sort'];

    public function imgUrl(){
        return $this->belongsTo('Image','img_id','id');
    }
}